package com.orgcent.activities.ainma;

import com.orgcent.activities.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
/**
 * 用于Activity间切换动画
 */
public class AActivity extends Activity {
	Bundle extras;

	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.anima_layout_a);
		setTitle("AActivity");
		// Window w = this.getWindow();
		extras = getIntent().getExtras();
		if (extras != null) {
			String animation = extras.getString("animation");
			if (animation != null && animation.equals("back")) {

				// 其中enterAnim 是下一个Activity的enter动画效果，exitAnim
				// 是当前Actitvity退出的动画效果
				overridePendingTransition(R.anim.push_left_in, R.anim.push_out);
				// w.setWindowAnimations(R.anim.push_left_out);
			} else {
				overridePendingTransition(R.anim.push_right_in, R.anim.push_out);
				// w.setWindowAnimations(R.anim.push_left_in);
			}
		} else {
			overridePendingTransition(R.anim.push_right_in, R.anim.push_out);
			// w.setWindowAnimations(R.anim.push_left_in);
		}

		Button nextBtn = (Button) findViewById(R.id.next);
		nextBtn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				Intent intent = new Intent(AActivity.this, BActivity.class);
				startActivity(intent);

			}

		});

	}

}
